# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-stem
pkgver=1.7.1
pkgrel=1
epoch=1
pkgdesc='A controller library for Tor.'
arch=('any')
url='https://pypi.org/project/stem/#files'
license=('LGPL3')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/stem-$pkgver.tar.gz")
sha512sums=('a275f59bba650cb5bb151cf53fb1dd820334f9abbeae1a25e64502adc854c7f54c51bc3d6c1656b595d142fc0695ffad53aab3c57bc285421c1f4f10c9c3db4c')

build() {
  cd "stem-$pkgver"

  python2 setup.py build
}

package() {
  cd "stem-$pkgver"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build

  mv "$pkgdir/usr/bin/tor-prompt" "$pkgdir/usr/bin/tor-prompt2"
}

